#include <stdio.h>
#define size 508

FILE *fi;
FILE *fn;
struct strings{
	char str[size];
	struct strings *next;
};
typedef struct contents{
	char name[100];
	char **str;
	int s;
}CONTENTS;


void readingF(FILE *fi,CONTENTS *con,char *name){
	FILE *temp;
	int count =0,i=0,co=0; 
	char buffer[size];
	temp=fopen(name,"r");
	while(fgets(buffer, size, temp)) co++; 
	con->str=(char**)calloc((co-1),sizeof(char)); con->s=co-1;
	for( i=0;i<co-1;i++) con->str[i]=(char*)calloc(size,sizeof(char));
		while( fgets(buffer, size, fi)){
			if(count==0) {strcpy(con->name,buffer);}
			else{
				strcpy(con->str[count-1],buffer);
			}
			count++;
		}
		fclose(temp); 
}

void readList(CONTENTS *con){
	char *name ="test.txt";
	if(fi=fopen(name,"r"))	readingF(fi,con,name);
 	fclose(fi);
}
 